#ifndef _COMMANDER_
#define _COMMANDER_

#include <iostream>

#include "aerial\Game\GameObject\FlyObject\FlyObject.h"


#include "hge\hge.h"
#include "hge\hgesprite.h"
#include "hge\hgevector.h"
#include "hge\hgeresource.h"

using namespace air;
using namespace std;

#define F_M_MOV		0x04
#define F_M_WUDI    0x20

#define F_M_ROT		0x18
#define F_V_CROT	0x08
#define F_V_CCROT	0x10

#define TYPE_COMMANDER 0x3

/// @brief a type of aircraft
class Commander: public FlyObject
{
public:
	Commander(int id, const char* username, float x, float y, uchar side, float A = 0.f);
	~Commander();

	void render();
	bool update(float dt);
	void processInput();

	inline virtual uchar GetFlightType() {	return TYPE_COMMANDER; }

	/**
	 * @brief move Commander according current status
	 *
	 * @param dt elapsed time
	 * @param flag 0 for static 1 for moving
	 */
	void move(float dt);

	/**
	 * @brief rotate Commander according current status
	 *
	 * @param dt elapsed time
	 */
	void turn(float dt);

private:
	hgeSprite* spr;
	int countDt,turnSide,rotateSide;

	float lastArmor;
	int judge,judgeWudi,countWudi,typeWudi;

	static const float SpeedPowerGen;
	static const float MaxPower;
	static const float MaxArmor;

	static const float MaxShieldRadius;
	/// @biref Commander's rad speed
	static const float RadiusPS;
	/// @brief Commander's max speed Max Pixel Per Second
	static const float MPPS;
};


#endif
